﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MediatorPattern
{
    /// <summary>
    /// 通用抽象中介者
    /// </summary>
    public abstract class Mediator
    {
        //定義同事類
        protected ConcreteColleagueOne c1;
        protected ConcreteColleagueTwo c2;

        //通過getter/setter方法把同事類注入進來
        public ConcreteColleagueOne getCOne()
        {
            return c1;
        }

        public void setCOne(ConcreteColleagueOne cOne)
        {
            this.c1 = cOne;
        }

        public ConcreteColleagueTwo getCTwo()
        {
            return c2;
        }

        public void setCTwo(ConcreteColleagueTwo cTwo)
        {
            this.c2 = cTwo;
        }

        //中介者模式的業務邏輯
        public abstract void doSomethingOne();
        public abstract void doSomethingTwo();

    }
}
